package com.lzj.server.common.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lzj.server.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;

@Schema(name = "Comment", description = "评论表（通用）：支持根评论 + 二级回复，适用于视频、文章等模块")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("comment")
public class Comment extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 523795655265423929L;


    @TableId(value = "id",type = IdType.AUTO)
    @Schema(description = "主键ID，自增")
    private Long id;
    @TableField("obj_id")
    @Schema(description = "评论所属对象ID，如视频ID、文章ID")
    private Long objId;
    @TableField("user_id")
    @Schema(description = "发表评论的用户ID")
    private Long userId;
    @TableField("parent_id")
    @Schema(description = "父评论ID，0表示根评论")
    private Long parentId;
    @TableField("reply_to_user_id")
    @Schema(description = "被回复的用户ID，用于展示“用户A回复用户B”的场景")
    private Long replyToUserId;
    @TableField("content")
    @Schema(description = "评论内容")
    private String content;
    @TableField("like_count")
    @Schema(description = "评论点赞数量")
    private Integer likeCount;
    @TableField("reply_count")
    @Schema(description = "根评论的回复数（冗余字段）")
    private Integer replyCount;
    @TableField("status")
    @Schema(description = "评论状态：0待审核，1通过，2驳回，3作废")
    private Integer status;

}

